package com.yaorange.controller;

import com.yaorange.api.Result;
import com.yaorange.entity.User;
import com.yaorange.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @company: yaorange
 * @author: 啊啊啊林
 * @version: 1.0
 * @create: 2021-09-26 10:29:55
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    //查找所有申请人
    @GetMapping("/all")
    public Result<?> getAllUser() {
        Result<List<User>> listResult = new Result<>();
       List<User> userList= userService.findAllUser();
        listResult.setSuccess(true);
        listResult.setData(userList);
        return listResult;
    }

}
